<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<title>用户修改</title>

<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="css/admin.css">
<script src="js/jq.js"></script>
<script src="js/admin.js"></script>
</head>
<script type="text/javascript">
$(function(){
	$.post("RoleServlet",{method:"findRole",fr:"updateUser"},function(data){
		//将Json转为js对象
		eval("var role = "+data);
		//获取下拉框对象
		var sel = $("#ReroleId");
		//请空下拉框
		sel.empty();
		//若角色不更换，value为0
		sel.append("<option value ='0'>不更换</option>")
		//遍历
		for(var i = 0;i<role.length;i++){
			sel.append("<option value ='"+role[i].roleId+"'>"+role[i].roleName+"</option>")
		}
	})
})
</script>
<body>
<div class="panel admin-panel ">
  <div class="panel-head" ><strong class="icon-reorder">修改分类</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="UserServlet?method=updateUserById"> 
    <!-- 用户编号 -->       
      <div class="form-group">
        <div class="label">
          <label>用户编号：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50"  value="${lu[0].userId}" disabled="disabled" />
          <input type="hidden" class="input w50" name="userId" value="${lu[0].userId}" />
          <div class="tips"></div>
        </div>
      </div>        
      
      <!-- 用户姓名 -->          
      <div class="form-group">
        <div class="label">
          <label>用户姓名：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="name" value="${lu[0].name}"/>         
        </div>
      </div>
      
     <!-- 账号 -->             
      <div class="form-group">
        <div class="label">
          <label>账号：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" name="userName" value="${lu[0].userName}"/>         
        </div>
      </div>
            
     <!-- 所属角色 -->            
      <div class="form-group">
        <div class="label">
          <label>所属角色：</label>
        </div>
        <div class="field">
        <!-- 获取的是隐藏的input -->  
        <input type="hidden" class="input w50" name="roleId" value="${lu[0].roleId}"/> 
        
        <c:if test="${lu[0].roleId==1 }">
        <input type="text" class="input w50" name="s_desc" value="超级管理员" disabled="disabled"/>         
        </c:if>
              
        <c:if test="${lu[0].roleId==2 }">
        <input type="text" class="input w50" name="s_desc" value="乡镇农合经办人" disabled="disabled"/>        
        </c:if>
        
        <c:if test="${lu[0].roleId==3 }">
        <input type="text" class="input w50" name="s_desc" value="县农合经办人" disabled="disabled"/>      
        </c:if>
        
        <c:if test="${lu[0].roleId==4 }">
        <input type="text" class="input w50" name="s_desc" value="县农合经办领导" disabled="disabled"/>
        </c:if>
        </div>
      </div>
      
     <!-- 更换角色 -->            
      <div class="form-group">
        <div class="label">
          <label>更换角色：</label>
        </div>
        <div class="field">
          <select name="ReroleId" id="ReroleId" class="input w50">
            </select>
          </div>
      </div>
      
      
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
</body>

</html>